import {request} from '@/apis';
import {addPrefix} from '@/utils/helper';

const prefixUrl = '/ep-query';

const Api = {
  /** 绿色债券列表 */
  GET_GREEN_BOND: '/getGreenBond',
  /** 绿债口径分类筛选 */
  GET_CALIBER_TYPE: '/screen/greenBondCaliberClassification',
  /** 绿债品种分类筛选 */
  GET_VARIETY_TYPE: '/screen/greenBondVarietyClassification',
  /** 绿债类型筛选 */
  GET_BOND_TYPE: '/screen/bondType',
  /** 绿债金融机构类型筛选 */
  GET_FINANCIAL_COMPANY_TYPE: '/screen/greenBondFinancialCompanyType',
  /** 绿债企业机构类型筛选 */
  GET_COMPANY_TYPE: '/screen/greenBondCompanyType',
  /** 绿色债券发行人列表 */
  GET_GREEN_BOND_RANK: '/getGreenBondRank',
  /** 绿色债券项目列表 */
  GET_GREEN_PROJECT: '/getGreenProject',
  /** 绿色债券项目类别筛选 */
  GET_GREEN_PROJECT_CLASS: '/screen/greenProjectClassification',
  /** 绿色债券项目归属类别筛选 */
  GET_GREEN_PROJECT_CATEGORY: '/screen/projectCategory',
  /** 绿色债券评估机构列表 */
  GET_GREEN_BOND_EVALUATION: '/getGreenBondEvaluation',
  /** 绿色债券详情接口*/
  GET_GREEN_BOND_DETAIL: '/getGreenBondDetail',
  /** 绿色债券项目详情接口*/
  GET_GREEN_PROJECT_DETAIL: '/getGreenProjectDetail',
  /** 绿色债券F9接口*/
  GET_GREEN_BOND_F9: '/getGreenBondF9',
  /** 绿色债券认证接口*/
  GET_GREEN_BOND_CERTIFICATION: '/getGreenBondCertification',
  /** 绿色主体认证接口*/
  GET_GREEN_ISSUE_CERTIFICATION: '/getGreenIssuerCertification',
  /** 绿色债券认证结果筛选接口*/
  GET_GREEN_BOND_CERTIFICATION_RESULT: '/screen/getGreenBondCertificationResult',
};

addPrefix(Api, prefixUrl);

// @ts-ignore
export * from './types';

/** 绿色债券列表获取接口 */
export const getGreenBond = (params) => request.get({url: Api.GET_GREEN_BOND, params});
/** 绿债口径分类筛选接口 */
export const getCaliberType = (params) => request.get({url: Api.GET_CALIBER_TYPE, params});
/** 绿债口径分类筛选接口 */
export const getVarietyType = (params) => request.get({url: Api.GET_VARIETY_TYPE, params});
/** 绿债类型筛选接口 */
export const getBondType = (params) => request.get({url: Api.GET_BOND_TYPE, params});
/** 金融机构筛选接口 */
export const getFinancialType = () => request.get({url: Api.GET_FINANCIAL_COMPANY_TYPE,});
/** 企业机构筛选接口 */
export const getCompanyType = () => request.get({url: Api.GET_COMPANY_TYPE,});

/** 绿色债券发行人列表获取接口 */
export const getGreenBondRank = (params) => request.post({url: Api.GET_GREEN_BOND_RANK, params});

/** 绿色债券项目列表获取接口 */
export const getGreenProject = (params) => request.post({url: Api.GET_GREEN_PROJECT, params});

/** 绿色债券项目类别筛选获取接口 */
export const getGreenProjectClass = (params) => request.get({
  url: Api.GET_GREEN_PROJECT_CLASS,
  params
});
/** 绿色债券项目归属类别筛选获取接口 */
export const getGreenProjectCategory = (params) => request.get({
  url: Api.GET_GREEN_PROJECT_CATEGORY,
  params
});

/** 绿色债券评估机构列表获取接口 */
export const getGreenBondEvaluation = (params) => request.get({
  url: Api.GET_GREEN_BOND_EVALUATION,
  params
});
/** 绿色债券详情接口 */
export const getGreenBondDetail = (params) => request.get({url: Api.GET_GREEN_BOND_DETAIL, params});

/** 绿色项目详情接口 */
export const getGreenProjectdDetail = (params) => request.get({
  url: Api.GET_GREEN_PROJECT_DETAIL,
  params
});

/** 绿色债券f9列表获取接口 */
export const getGreenBondF9 = (params) => request.get({url: Api.GET_GREEN_BOND_F9, params});
/** 绿色债券认证列表获取接口 */
export const getGreenBondCertification = (params) => request.post({
  url: Api.GET_GREEN_BOND_CERTIFICATION,
  params
});
/** 绿色主体认证列表获取接口 */
export const getGreenIssueCertification = (params) => request.post({
  url: Api.GET_GREEN_ISSUE_CERTIFICATION,
  params
});
/** 绿色主体认证结果筛选获取接口 */
export const getGreenCertificationResult = (params) => request.get({
  url: Api.GET_GREEN_BOND_CERTIFICATION_RESULT,
  params
});
